import { request, requestMock } from '@/utils/http'

export const getCategoryListRequest = () => {
  return request.get('/api/product/getBaseCategoryList')
}



//请求banner的数据
export const getBannerListRequest = () => {
  return requestMock.get('/banner')
}

//请求floor的数据
export const getFloorListRequest = () => {
  return requestMock.get('/floor')
}

//请求搜索页的数据
export const getSearchlistRequest = (params) => {
  return request.post('/api/list', params)
}

//请求详情页的数据
export const requestDetailList = (skuId) => {
  return request.get(`/api/item/${skuId}`)
}

//点击添加到购物车的请求
export const requestAddOrUpdataNumCart = ({ skuId, skuNum }) => {
  return request.post(`/api/cart/addToCart/${skuId}/${skuNum}`)
}

//获取购物车列表
export const requestCartList = ()=>{
  return request.get('/api/cart/cartList')
}